package org.dtrd.modules.common.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.common.entity.bean.WechatQrcodeDetail;

import java.util.Date;


/**
 * <p>
 * 
 * </p>
 *
 * @author xiao
 * @since 2022-06-01
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_wechat_qrcode")
public class DtrdEntRdWechatQrcode {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("create_time")
    private Date createTime;

    /**
     * 微信公众号openid
     */
    @TableField("wx_oa_open_id")
    private String wxOaOpenId;

    /**
     * 生成微信公众号二维码时返回的url
     */
    @TableField("wx_oa_qrcode_url")
    private String wxOaQrcodeUrl;

    /**
     * 微信公众号标签，逗号拼接
     */
    @TableField("wx_oa_tags")
    private String wxOaTags;

    /**
     * 二维码类型
     */
    @TableField("wx_oa_qrcode_type")
    private Integer wxOaQrcodeType;

    public DtrdEntRdWechatQrcode init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdEntRdWechatQrcode parseFromDto(WechatQrcodeDetail dto) {
        dataId = dto.getDataId();
        wxOaOpenId = dto.getWxOaOpenId();
        wxOaQrcodeUrl = dto.getWxOaQrcodeUrl();
        wxOaTags = dto.getWxOaTags();
        wxOaQrcodeType = dto.getWxOaQrcodeType();
        return this;
    }


}
